<?php
class ProfilesController extends AppController {
    
    var $name = 'Profiles';
    var $components = array('Auth');
    var $helpers = array('Html', 'Form');
    
    function update($id = null) {
        
        $this->set('title_for_layout', 'Update Profile Information');
        $this->Profile->id = $id;
        if (empty($this->data)) {
            $this->data = $this->Profile->read();
        } else {
            if ($this->Profile->save($this->data)) {
#                $this->Session->setFlash('Your profile has been updated!');
                $this->redirect(array('controller' => 'users','action' => 'index', $this->Auth->user('id')));
            }
        }
    }

      
}
